package com.ld.security.shop.crawler.modules.wo.service.impl;

import com.ld.security.common.core.util.TreeUtil;
import com.ld.security.common.mybatis.constant.SqlCondition;
import com.ld.security.common.mybatis.core.wrapper.EntityWrapper;
import com.ld.security.shop.crawler.modules.wo.mapping.IWoRuleMapping;
import com.ld.security.shop.crawler.modules.wo.service.IWoRuleService;
import com.ld.security.shop.crawler.modules.wo.entity.WoRule;
import com.ld.security.common.mybatis.base.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
class WoRuleServiceImpl extends ITreeServiceImpl<WoRule> implements
        IWoRuleService {

    @Autowired
    IWoRuleMapping iWoRuleMapping;

    @Override
    public List<WoRule> findByParseId(String parseId) {

        WoRule q =  this.newInstance();
        q.setParseId(parseId);
        List<WoRule> woRules =        this.all(q);
       return TreeUtil.dfsBuildTree(woRules);

    }
}
